<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/common/taglibs.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件上传</title>
<script type="text/javascript" src="${ctx }/scripts/swfupload/swfupload.js"></script>
<link href="${ctx }/scripts/swfupload/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx }/scripts/swfupload/swfupload.queue.js"></script><!-- 上传队列组件 -->
<script type="text/javascript" src="${ctx }/scripts/swfupload/fileprogress.js"></script><!-- 进度条组件 -->
<script type="text/javascript" src="${ctx }/scripts/swfupload/handlers.js"></script><!-- 上传处理函数 -->
<script type="text/javascript" src="${ctx }/scripts/swfupload/swfupload.swf"></script>
<script type="text/javascript">
var swfu;
window.onload = function() {
	var settings ={
	     button_placeholder_id : "spanButtonPlaceholder", 
	     button_image_url : "${ctx }/scripts/swfupload/XPButton.png",  
	     button_width: 61,  
	     button_height: 22,  
	     button_text :"浏览文件",
         flash_url : "${ctx }/scripts/swfupload/swfupload.swf",// 定义用的swfUpload组件flash
         upload_url: "${ctx }/attachment/attachment!save.action",       //相对于SWF 文件的上传路径
         file_post_name : "upfile", //POST过去的字段名
         post_params: {"tableId" : "${param.tableId}","partId":"${param.partId}","tableName":"${param.tableName}","tableField":"${param.tableField}","type":"${param.type}"},
         file_size_limit : "${param.file_size_limit}",//设定上传大小
         file_types : "${param.file_types}",//类型限制
         file_types_description : "${param.tableField}",//打开选择窗口的类型说明文字
         file_upload_limit : 100,// 实例控制上传成功的文件总数
         file_queue_limit : 0,// 设置文件上传队列中等待文件的最大数量限制
         debug:false,//是否显示调试窗口
         custom_settings : {//自定义变量
                   progressTarget : "fsUploadProgress", //进度条展示的容器id
                   cancelButtonId : "btnCancel"//取消按钮
         },
         //下面的事件都被定义在了 handlers.js
         file_queued_handler : fileQueued,
         file_queue_error_handler : fileQueueError,
         file_dialog_complete_handler : fileDialogComplete,
         upload_start_handler : uploadStart,
         upload_progress_handler : uploadProgress,
         upload_error_handler : uploadError,
         upload_success_handler : uploadSuccess,
         upload_complete_handler : uploadComplete
	};
	swfu= new SWFUpload(settings);
  };
 
</script>
</head>
<div class="content ">
	<div class="button">
		<ul>
		<li><input id="spanButtonPlaceholder" type="button" value="浏览文件" onclick="swfu.selectFiles();" /></li>
		<li><input type="button" name="button" id="button" value="上传文件"   onclick="swfu.startUpload();" /></li>
		<li><input id="btnCancel" type="button" onclick="swfu.cancelQueue();" value="取消上传" disabled="disabled" /></li>
		</ul> 
	</div>
	<div class="uploadlist">
	<fieldset class="flash" id="fsUploadProgress"  >
	<legend align="">上传列表</legend>
	</fieldset>
	</div>
</div>
</html>